<?php
/**
 * ExtPagingToolbarBase class file
 *
 * @author TrueSoftware B.V. (The Netherlands)
 * @link http://www.ext4yii.com
 * @copyright Copyright 2007-2010 TrueSoftwareB.V. all rights reserved.
 * @license http://www.ext4yii.com/license/
 *          EVALUATION VERSION - NOT FOR COMMERCIAL USE OR DISTRIBUTION.
 * @version 0.7.2
 */
 
 
abstract class ExtPagingToolbarBase extends ExtToolbar
{
    public function renderConfig($asobject=true)
    {
        if(!is_null($this->parent) && ($this->parent instanceof ExtGridPanel))
        {
            $store = $this->getController()->getDataStoreById($this->parent->getStore());
            if(!is_null($store))
            {
                if($store->getAutoLoad())
                {
                    $store->setConfig('autoLoad',false);
                    $this->getController()->addAfterInitScript(
                        sprintf('(function(){Ext.getCmp("%s").doRefresh(); }.defer(100,this))',
                                $this->getId()));
                    $this->setConfig('store', $this->parent->getStore());
                }
            }
        }
        return parent::renderConfig($asobject);
    }
}
?>
